﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.Sql;
using System.Data.SqlClient;
using System.Data;
using WebApplication1.MSG;

namespace WebApplication1
{
    public partial class Change_Task : System.Web.UI.Page
    {
        static string flag;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {


                ViewState["UrlReferrer"] = Request.UrlReferrer.ToString();
            }
            flag = Request["flag"];


            
        }
        
        protected void Button1_Click1(object sender, EventArgs e)
        {
            DBS me = new DBS();

            me.Change_Task_State(flag, TextBox1.Value.ToString());
       
            UserInfo us= new UserInfo();

            us.Init(Request.Cookies["UserPhone"].Value.ToString());

            me.Add_Task_Log(flag, TextBox1.Value.ToString(), us.ChineseName, DateTime.Now.ToLocalTime().ToString());

            Response.Redirect((String)ViewState["UrlReferrer"]);
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            DBS me = new DBS();

            me.Change_Task_State(flag,"任务完成");
           
            Response.Redirect((String)ViewState["UrlReferrer"]);
        }

      
    }
}